package main

import (
	"fmt"
)

/* func main() {
	//定义常量
	const PI float32 = 3.14
	const PI2 = 3.1415 //省略类型

	const (
		width  = 100
		height = 200
	)
	//多重赋值
	const i, j = 1, 2
	const a, b, c = 1, 2, "hi"
	//同时声明多个常量，忽略值表示与上行相同
	const (
		a1 = 100
		a2
		a3
	)
	fmt.Printf("a1: %v\n", a1)
	fmt.Printf("a2: %v\n", a2) //100
	fmt.Printf("a3: %v\n", a3) //100
} */

// iota - 可被编译器修改的常量，默认值开始为0，每次调用+1，遇const重置为0
func main() {
	/* 	const (
		a1 = iota //0
		a2 = iota //1
		a3 = iota //2
	) */

	//使用_跳过某些值
	/* const (
		a1 = iota //0
		_
		a2 = iota //2
	) */

	//const声明中间插队
	const (
		a1 = iota //0
		a2 = 100  //100
		a3 = iota //2
	)
	fmt.Printf("a1: %v\n", a1)
	fmt.Printf("a2: %v\n", a2)
	fmt.Printf("a3: %v\n", a3)
}
